package helper;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Random;


public class Config {
	private static Properties p;
	static {

		try {
			p = new Properties();
			ClassLoader cl = Config.class.getClassLoader();
			InputStream is = cl.getResourceAsStream("properties.properties");
			p.load(is);
			
		} catch (IOException e) {
			
			e.printStackTrace();
		}
	}
	
	public static double getX(){
		return new Double(p.getProperty("x"));
	}
	public static double getY(){
		return new Double(p.getProperty("y"));
	}
	public static double getSensingRadius(){
		return new Double(p.getProperty("r"));
	}
	public static int getSensorNumber(){
		return new Integer(p.getProperty("N"));
	}
	public static int getIntervalNumber(){
		return new Integer(p.getProperty("T"));
	}
	public static double getBattery() {
		return new Double(p.getProperty("battery"));
	}
	public static double getPOIdistance() {
		return new Double(p.getProperty("g"));
	}

        public static String getResultFolder() {
            return p.getProperty("resultFolder");
        }

    public static int getNumberOfPOIs() {
        return new Integer(p.getProperty("POInumber"));
    }

    private static Random random;

    public static Random getSalt() {
        if (random != null) {
            return random;
        }

        long salt = new Long(p.getProperty("salt"));
        if (salt == 0) {
            random = new Random();
        } else {
            random = new Random(salt);
        }
        return random;
    }
	

}
